<template>
  <div class="border">
    <div>我是组件A</div>
    <Button @click="additionHandle" type="primary">+加法器</Button>
  </div>
</template>
 
<script>
import { EventBus } from "./event-bus.js";
export default {
  data() {
    return {
      num: 1
    };
  },

  methods: {
    additionHandle() {
      EventBus.$emit("addition", {
        num: this.num++
      });
    }
  }
};
</script>
<style scoped>
.border {
  border: 1px solid blueviolet;
  border-radius: 5px;
  padding: 24px;
}
</style>